<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Prop</title>
</head>
<body>
    <!-- 引入React核心库 -->
    <script src="../JS/react.development.js"></script>
    <!-- 引入ReactDOM，用于支持react操作DOM -->
    <script src="../JS/react-dom.development.js"></script>
    <!-- 引入babel 用于将书写的JSX语法 编译成JS语法 -->
    <script src="../JS/babel.min.js"></script>


    <div id="test1"></div>
    <div id="test2"></div>
    <div id="test3"></div>


    <script type="text/babel">
        class Person extends React.Component{
            render(){
                const {name,age,sex} = this.props
                return(
                    <ul>
                        <li>姓名:{name}</li>
                        <li>性别:{sex}</li>
                        <li>年龄:{age}</li>
                    </ul>
                )
            }
        }
        ReactDOM.render(<Person name="Altria" sex="女" age="14" />,document.getElementById('test1'))
        ReactDOM.render(<Person name="hkk" sex="男" age="24" />,document.getElementById('test2'))
        ReactDOM.render(<Person name="WYH" sex="女" age="22" />,document.getElementById('test3'))
    </script>


</body>
</html>